//
//  SEGCommentListModel.m
//  ExcellentHome
//
//  Created by 刘山 on 2016/10/14.
//  Copyright © 2016年 陈区. All rights reserved.
//

#import "SEGCommentListModel.h"

@implementation SEGCommentListModel
- (instancetype)initWithDictionary:(NSDictionary*)dictionary
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dictionary];
    }
    return self;
}
+ (instancetype)initWithDictionary:(NSDictionary*)dictionary
{
    return [[self alloc] initWithDictionary:dictionary];
}
- (void)setValue:(id)value forUndefinedKey:(NSString*)key
{
}

- (void)setValue:(id)value forKey:(NSString*)key
{
    if ([key isEqualToString:@"hotList"]) {

        NSMutableArray* _arrM = [NSMutableArray array];

        for (NSDictionary* dict in value) {

            SEGPictorialHotListModel* model = [SEGPictorialHotListModel initWithDictionary:dict];

            [_arrM addObject:model];
        }

        self.hotList = _arrM.copy;

        return;
    }

    if ([key isEqualToString:@"commentList"]) {

        NSMutableArray* _arrM = [NSMutableArray array];

        for (NSDictionary* dict in value) {

            SEGPictorialCommentListModel* model = [SEGPictorialCommentListModel initWithDictionary:dict];

            [_arrM addObject:model];
        }

        self.commentList = _arrM.copy;

        return;
    }

    [super setValue:value forKey:key];
}
@end
